This pull request refactors and modularizes the FastAPI application, improving maintainability and clarity.#10
Merged
goldlabelapps merged 2 commits intomasterfrom Mar 19, 2026
Merged
Conversation
Bump version to 1.0.3 and reorganize API structure: rename print_products.py to app/api/db.py and expose get_db_connection as a PostgreSQL dependency; add new routers (root, health, echo) and pydantic schemas (EchoRequest/EchoResponse); update app/api/routes.py to include the new routers and import the shared DB dependency/schemas, removing inline DB and model definitions; add app/api files and remove legacy scripts (seed_product_table.py, test_db_connection.py).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It introduces new API endpoints, reorganizes database connection logic, and removes standalone scripts in favor of integrated FastAPI routes. The most important changes are grouped below:
API Endpoint Additions and Refactoring:
health,echo, and a structured root endpoint that returns metadata and product data (app/api/health.py,app/api/echo.py,app/api/root.py). [1] [2] [3]app/api/routes.pyto include routers from newly created endpoint modules, removing inline endpoint and schema definitions.Database Connection Handling:
app/api/db.py(renamed fromapp/print_products.py), providing a dependency-compatible function for FastAPI instead of a standalone script.Schema Definitions:
EchoRequestandEchoResponsePydantic models in a dedicatedapp/api/schemas.pyfile for request and response validation.Cleanup and Removal of Standalone Scripts:
app/seed_product_table.py,app/test_db_connection.py) in favor of integrated FastAPI endpoints and dependency management. [1] [2]Version Tracking:
1.0.2to1.0.3inapp/__init__.py.